package com.csh.subject.common.enums;

import lombok.Getter;

/**
 * 题目类型枚举
 * 1单选 2多选 3判断 4简答
 */
@Getter
public enum SubjectInfoTypeEnum {
    //枚举类的对象名称，定义多少个就有多少个对象
    RADIO(1,"单选"),
    MULTIPLE(2,"多选"),
    JUDGE(3,"判断"),
    BRIEF(4,"简答");

    private int code;
    private String msg;

    SubjectInfoTypeEnum(int code , String msg){
        this.code = code;
        this.msg = msg;
    }


    public static SubjectInfoTypeEnum getByCode(int codeValue){
        for(SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()){
            if (resultCodeEnum.code == codeValue){
                return resultCodeEnum;
            }
        }
        return null;
    }
}
